package chapter04

/**
 * @program lu-scala01
 * @description:  不可变的集合
 *  -- 不重复
 *  -- 无序
 * @author: zhanglu
 * @create: 2022-04-08 22:05:00
 */
object Lu06_ImmutableSet {

  def main(args: Array[String]): Unit = {
    val s1 = Set(1, 2, 3, 2, 4)
    println(s1)

    val s2 = s1 + 5
    println(s1)
    println(s2)

    val s3 = s1 ++ s2 + 6
    println(s3)

    val s4 = s3 - 1
    println(s4)

  }

}
